public class DetailPlanEligibilityVF
{
    private final Plan__c[] plan = new Plan__c[1];
    public Plan_Role__c[] planRole {get; set;}

    public DetailPlanEligibilityVF(ApexPages.StandardController myController)
    {
        this.plan[0] = (Plan__c)myController.getRecord();
        planRoleList();
    }
    
    public void planRoleList()
    {
        planRole = [select Id, Description__c, RoleTitle__c from Plan_Role__c where Plan__c = :plan[0].id];
        if(planRole.size() == 0) 
        	planRole = null;
    }
    
/*    public List<SelectOption> getPlanRoleCBID() {
        List<SelectOption> options = new List<SelectOption>();
        if(planRole != null)
            for(Plan_Role__c pRole: planRole)
            {
                options.add(new SelectOption(pRole.Id, ''));
            }
        return options;    
    }
    
    public String[] getPRoles() {
        return pRoles;
    }
    public void setPRoles(String[] pRoles) {
        this.pRoles = pRoles;
    }
    
    public List<Plan_Role__c> getPlanRole()
    {
        return planRole;
    }
    
    public void setPlanRole(List<Plan_Role__c> planRole)
    {
        this.planRole = planRole;
    }
    */

/*    public PageReference removeEligibility()
    {
        for(Plan_Role__c pr: [select id from Plan_Role__c where id in :pRoles])
            delete pr;
        planRoleList();         
        getPlanRoleCBID();
        return null;
    }    
*/
/*
    public PageReference addEligibility()
    {
        if(byRoleTitle == 'byTitle')
            titlesList.add(new TitleWrapper());
        else 
            rolesList.add(new RoleWrapper());
        return null;
    }    

    public PageReference saveEligibility()
    {
        return null;
    }    

    public PageReference cancelEligibility()
    {
        return null;
    }    

    public PageReference removeEligibility2()
    {
        if(byRoleTitle == 'byRole' && rolesList.size() > 0)
            rolesList.remove(rolesList.size() - 1);
        else if(titlesList.size() > 0)
            titlesList.remove(titlesList.size() - 1);
        return null;
    }    

    public PageReference checkSelection()
    {
        if(byRoleTitle == 'byTitle')
        {
            for(RoleWrapper ur: rolesList)
                rolesDupList.add(ur);
            rolesList.clear();
            if(titlesDupList.size() > 0)
            {
                for(TitleWrapper u: titlesDupList)
                    titlesList.add(u);
                titlesDupList.clear();
            }
            
        }
        else
        {
            for(TitleWrapper u: titlesList)
                titlesDupList.add(u);
            titlesList.clear();
            if(rolesDupList.size() > 0)
            {
                for(RoleWrapper ur: rolesDupList)
                    rolesList.add(ur);
                rolesDupList.clear();
            }
        }
        return null;
    }    
    
    public class RoleWrapper 
    {
        public String selectedRole {get; set;}
        public List<SelectOption> getRoles() 
        {
            List<SelectOption> options = new List<SelectOption>();
            
            options.add(new SelectOption('select', 'Select'));
            for(UserRole[] uRoleList: [select Id, Name from UserRole order by Name])
            {
                if(options.size() >= 1000)
                    break;
                for(UserRole ur: uRoleList)
                    options.add(new SelectOption(ur.Id, ur.Name));
            }
            return options; 
        }
    }
    
    public List<RoleWrapper> getRoleRows() {
        return rolesList;
    }

    public class TitleWrapper 
    {
        public String selectedTitle {get; set;}
        public List<SelectOption> getTitles() 
        {
            List<SelectOption> options = new List<SelectOption>();
            
            options.add(new SelectOption('select', 'Select'));
            for(User[] usersList: [select Title from User where Title != '' order by Title])
            {
                if(options.size() >= 1000)
                    break;
                for(User u: usersList)
                    options.add(new SelectOption(u.Id, u.Title));
            }
            return options; 
        }
    }
    
    public List<TitleWrapper> getTitleRows() {
        return titlesList;
    }
    */
}